#pragma once

#include <string>

#include <boost/enable_shared_from_this.hpp>

#include "packet.h"
#include "connection_base.h"

namespace anb { namespace net {

class cmd_handler
{
public:
	cmd_handler();
	virtual ~cmd_handler();

	typedef boost::shared_ptr<cmd_handler> ptr;

	unsigned short cmd;
	std::string name;
	size_t size_limit;

	packet::body_type in_body;
	packet::body_type out_body;
	std::string description;

	size_t integer_size;

	virtual void handle(connection_base::ptr conneciton, const uv_buf_t buf);

protected:
private:
};

} }
